home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / com_and3.zip / SCRDUMP.CMD < prev    next >
OS/2 REXX Batch file  |  1990-03-31  |  1KB  |  37 lines

  1. S1 = "COM-AND.SCR"              ; Current subdir, scr dump fname
  2. ; ----- Dump the current screen to disk
  3. ;
  4. ;    R.McG; 3/31/90
  5. ; ---------------------------------------------
  6. ;
  7. ;    Open a disk file
  8. ;
  9.    FOPENO S1 TEXT APPEND    ; Open output file (appending this)
  10.    IF NOT SUCCESS        ; If open failed
  11.       MESS "Error opening output file: "*S1
  12.       EXIT            ; And stop
  13.       ENDIF
  14. ;
  15. ;    Write the current screen to disk
  16. ;
  17.    N0 = "_SSIZE"                ; get the current screen # lines
  18.    N1 = 0            ; Start on line 0
  19.    IF STRCMP "_MENU" "ON" N1=1  ; .. unless menu mode is on
  20.    FOR N2 = N1,(N0-2)        ; Skip status line, too
  21.        ATSCR N2 0 80 S0     ; Read 80 chars from screen
  22.        S1 = S0(40:79)        ; Save high 40 chars
  23.        S0 = S0(0:39)        ; And low 40
  24.        PRESERVE S0        ; Turn ! into !!, ^ into ^^
  25.        PRESERVE S1        ; ..
  26.        WRITE S0         ; Write to disk
  27.        WRITE S1         ; ..
  28.        WRITE "!"                ; And a crlf
  29.        ENDFOR
  30. ;
  31. ;    And done
  32. ;
  33.    WRITE "^L"                   ; A top-of-form
  34.    FCLOSEO            ; Close file
  35.    IF FCALL FRET        ; If fcalled, return to caller
  36.    EXIT             ; Else stop
  37.